﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SistemaAcademicoDAL;
using SistemaAcademicoBO.Entities;
using SistemaAcademicoBO;

namespace SistemaAcademicoBLL.Managers
{
    class ProfessorSubjectManager
    {
        private ProfessorSubjectDAO professorSubjectDAO;

        public ProfessorSubjectManager()
        {
            professorSubjectDAO = new ProfessorSubjectDAO();
        }

        public ProfessorSubject GetProfessorSubject(int professorId,int SubjectId)
        {
            return (ProfessorSubject)professorSubjectDAO.GetRecord(professorId,SubjectId);
        }

        public List<ProfessorSubject> GetAllProfessorSubjects()
        {
            List<IEntity> entityList = professorSubjectDAO.GetAllRecords();
            List<ProfessorSubject> professorSubjectList = new List<ProfessorSubject>();
            foreach (IEntity entity in entityList)
            {
                professorSubjectList.Add((ProfessorSubject)entity);
            }

            return professorSubjectList;
        }

        public void SetProfessorSubject(ProfessorSubject professorSubject)
        {
            professorSubjectDAO.SetRecord(professorSubject);
        }

        public void RemoveProfessorSubject(int professorId, int SubjectId)
        {
            professorSubjectDAO.RemoveRecord(professorId, SubjectId);
        }
    }
}
